<form id="ace-searchbox" name="frmSearch" class="form-horizontal" ng-init="dvm.init()"
    ng-submit="vm.execute(frmSearch.$valid)" novalidate>
  <div class="modal-header">
    <button type="button" class="close" ng-click="dvm.close()">&times;</button>
    <h4 class="modal-title">查找/替换</h4>
  </div>
  <div class="modal-body">
    <div class="form-group">
      <div class="col-sm-12">
        <input name="needle" type="text" class="form-control" ng-model="dvm.context.needle" required autofocus
            placeholder="查找内容">
      </div>
    </div>
    <div class="form-group">
      <div class="col-sm-12">
        <input type="text" class="form-control" ng-model="dvm.context.replace" placeholder="替换为">
      </div>
    </div>
    <div class="form-group">
      <div class="col-sm-12">
        <label class="radio-inline">
          <input name="backwards" type="radio" ng-value="false" ng-model="dvm.context.backwards">向前
        </label>
        <label class="radio-inline">
          <input name="backwards" type="radio" ng-value="true" ng-model="dvm.context.backwards">向后
        </label>
      </div>
    </div>
    <div class="form-group">
      <div class="col-sm-12">
        <label class="checkbox-inline">
          <input type="checkbox" ng-value="true" ng-model="dvm.context.caseSensitive">区分大小写
        </label>
        <label class="checkbox-inline">
          <input type="checkbox" ng-value="true" ng-model="dvm.context.wholeWord">全单词匹配
        </label>
      </div>
    </div>
    <div class="form-group">
      <div class="col-sm-12">
        <label class="checkbox-inline">
          <input type="checkbox" ng-value="true" ng-model="dvm.context.regExp">正则表达式
        </label>
        <label class="checkbox-inline">
          <input type="checkbox" ng-value="true" ng-model="dvm.context.wrap">回到文档顶部
        </label>
      </div>
    </div>
  </div>
  <div class="modal-footer">
    <button type="submit" class="btn btn-primary" ng-click="dvm.find()"
        ng-disabled="dvm.context.needle == '' || dvm.disabled">查找</button>
    <button type="button" class="btn btn-success" ng-click="dvm.replace()"
        ng-disabled="dvm.context.needle == '' || dvm.disabled">替换</button>
    <button type="button" class="btn btn-warning" ng-click="dvm.replaceAll()"
        ng-disabled="dvm.context.needle == '' || dvm.disabled">替换全部</button>
  </div>
</form>
